#ifndef _CLASS_G_H__
#define _CLASS_G_H__

#include <string>

class CNumberEx
{
public:
	CNumberEx() :m_nNum(0){}
	CNumberEx(int num) :m_nNum(num){}
	~CNumberEx(){}

	void SetNumber(int num)    { m_nNum = num; }
	int GetNumber(){ return m_nNum; }
	int Add(int num){ m_nNum += num; return m_nNum; }
protected:
	int m_nNum;
};

class CMessageEx{
public:
	CMessageEx(){ strcpy(m_szMessage, "init message"); }
	CMessageEx(char *initMsg){ if (initMsg) strcpy(m_szMessage, initMsg); }
	~CMessageEx(){}
	void SetMessage(char *initMsg){ if (initMsg) strcpy(m_szMessage, initMsg); }
	char *GetMessage(){ return m_szMessage; }
	void ShowMessage(){ printf("msg:%s\n", m_szMessage); }

protected:
	char m_szMessage[256];
};

class CTestSystem
{
public:
	static CTestSystem &GetSingleton(){
		static CTestSystem sys;
		return sys;
	}


	CNumberEx& GetNumberObj(){ return m_number; }
	CMessageEx & GetMessageObj(){ return m_message; }
protected:
	CTestSystem(){}
	CTestSystem(const CTestSystem &){}
	~CTestSystem(){}
	CTestSystem& operator=(const CTestSystem &rhs);

private:
	CNumberEx m_number;
	CMessageEx m_message;
};

#endif/*_CLASS_G_H__*/